import request from './utils/request'
export default {
  addQuestion(object) {
    return request({
      url: `/eduservice/edu_question/retId`,
      method: 'post',
      data: object
    })
  },
  addChoiceQuestion(object) {
    return request({
      url: `/eduservice/edu_question_choice/retId`,
      method: 'post',
      data: object
    })
  },
  getQuestions(chapterId){
    return request({
      url:`/eduservice/edu_question_choice/${chapterId}`,
      method:'get'
    })
  },
  deleteQuestionAndMid(id) {
    return request({
      url: `/eduservice/chapter_aquestion_type_sys_and_question/${id}`,
      method: 'delete',

    })
  },
  deleteChoiceQuestionAndMid(id) {
    return request({
      url: `/eduservice/chapter_aquestion_type_sys_and_choicequestion/${id}`,
      method: 'delete',

    })
  },
  deletePaperQuestionAndMid(id) {
    return request({
      url: `/eduservice/paper_type_and_question/${id}`,
      method: 'delete',

    })
  },
  deletePaperChoiceQuestionAndMid(id) {
    return request({
      url: `/eduservice/paper_type_and_choicequestion/${id}`,
      method: 'delete',

    })
  },

  updateQuestion(question) {
    return request({
      url: `/eduservice/edu_question/`,
      method: 'put',
      data: question
    })
  },
  getQuestionsByCourseId(courseId){
    return request({
      url:`/eduservice/edu_question/getsBycourseId/${courseId}`,
      method:'get'
    })
  },
  getChoiceQuestionsByCourseAndType(courseId,typeId){
    return request({
      url:`/eduservice/edu_question_choice/getsByCourseAndType/${courseId}/${typeId}`,
      method:'get'
    })
  },
  getQuestionsByCourseAndType(courseId,typeId){
    return request({
      url:`/eduservice/edu_question/getsByCourseAndType/${courseId}/${typeId}`,
      method:'get'
    })
  },
  getQuestionsByfolderId(folderId){
    return request({
      url:`/eduservice/edu_question/getsByfolderId/${folderId}`,
      method:'get'
    })
  },
  getQuestionsByTypeId(current,limit,searchObj){
    return request({
      url:`/eduservice/edu_question/page/${current}/${limit}`,
      method:'post',
      data:searchObj
    })
  },
  getChoiceQuestionsByTypeId(current,limit,searchObj){
    return request({
      url:`/eduservice/edu_question_choice/page/${current}/${limit}`,
      method:'post',
      data:searchObj
    })
  },
  GetQuestionsByQuestionTypeSys(current,limit,searchObj){
    return request({
      url:`/eduservice/edu_question/pageByTypeAndCourse/${current}/${limit}`,
      method:'post',
      data:searchObj
    })
  },
  GetChoiceQuestionsByQuestionTypeSys(current,limit,searchObj){
    return request({
      url:`/eduservice/edu_question_choice/pageByTypeAndCourse/${current}/${limit}`,
      method:'post',
      data:searchObj
    })
  },
  getQuestionsByPaperTypeId(current,limit,searchObj){
    return request({
      url:`/eduservice/edu_question/pageByPaper/${current}/${limit}`,
      method:'post',
      data:searchObj
    })
  },
  getChoiceQuestionsByPaperTypeId(current,limit,searchObj){
    return request({
      url:`/eduservice/edu_question_choice/pageByPaper/${current}/${limit}`,
      method:'post',
      data:searchObj
    })
  },
}
